package com.rhythm.commons.validation;

import static com.rhythm.commons.validation.MessageType.*;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author Michael J. Lee
 */
public class MockCompanyValidator1 implements Validator<MockCompany> {

    public void checkState(MockCompany obj) throws InvalidStateException {

        //InvalidStateExceptionBuilder exceptionBuilder = new InvalidStateExceptionBuilder();

        ExceptionBuilder builder = new ExceptionBuilder();


        builder.assertNotNull(SEVERE, obj,  "expected [" + MockCompany.class.getName() + "] but was [null]", true);

        builder.assertNotNull(SEVERE, obj, "Name cannot be null");
        builder.assertFalse(SEVERE, obj.getName().length() < 10, "Name must be less greater than 10 chars");
        builder.assertFalse(WARNING, obj.getName().length() == 0,"Name is empty");

        builder.trySuppress ();

    }

}
